class Solution {
public:
    string intToRoman(int num) {
  char Rome[7]={'I','V','X','L','C','D','M'};
    vector<char>rome;
   string gets_char[20];
    while(num!=0)
    {
        if(num>=1000)
        {
            num-=1000;
            rome.push_back(Rome[6]);
            continue;
        }
        if(num>=900)
        {
            num-=900;
            rome.push_back(Rome[4]);
            rome.push_back(Rome[6]);
            continue;
        }
        if(num>=500)
        {
            num-=500;
            rome.push_back(Rome[5]);
            continue;
        }
          if(num>=400)
        {
            num-=400;
            rome.push_back(Rome[4]);
            rome.push_back(Rome[5]);
            continue;
        }
         if(num>=100)
        {
            num-=100;
            rome.push_back(Rome[4]);
            continue;
        }
        if(num>=90)
        {
            num-=90;
            rome.push_back(Rome[2]);
            rome.push_back(Rome[4]);
            continue;
        }
         if(num>=50)
        {
            num-=50;
            rome.push_back(Rome[3]);
            continue;
        }
         if(num>=40)
        {
            num-=40;
            rome.push_back(Rome[2]);
            rome.push_back(Rome[3]);
            continue;
        }
         if(num>=10)
        {
            num-=10;
            rome.push_back(Rome[2]);
            continue;
        }
         if(num>=9)
        {
            num-=9;
            rome.push_back(Rome[0]);
            rome.push_back(Rome[2]);
            continue;
        }
         if(num>=5)
        {
            num-=5;
            rome.push_back(Rome[1]);
            continue;
        }
         if(num>=4)
        {
            num-=4;
            rome.push_back(Rome[0]);
            rome.push_back(Rome[1]);
            continue;
        }
          if(num>=1)
        {
            num-=1;
            rome.push_back(Rome[0]);
             continue;
        }
    }
    for(int i=0;i<rome.size();i++)
    {
        gets_char[i]=rome[i];
    }return gets_char[20];
    }
};